﻿// ***********************************************************************
// Assembly         : MVC4Portal
// Author           : LJO+01 (Laurent Jordi)
// Created          : 06-05-2013
// Last Modified By : LJO+01 (Laurent Jordi)
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="DynaContentPrivateController.cs" company="Copyright © Innovacall 2011">
//     Copyright (c) Copyright © Innovacall 2011. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using InnovaApp.Portals.MVC4Portal.Models;
using InnovaApp.Portals.MVC4Portal.Models.ViewModels.LayoutViewModels.DynaContentViewModels;
using INNOVACALL.Framework.Common.MVCHelpers;

namespace InnovaApp.Portals.MVC4Portal.Controllers.ViewControllers.LayoutViewControllers.DynaContents
{
    /// <summary>
    /// Class DynaContentPrivateController
    /// </summary>
    public class DynaContentPrivateController : _DynaContents_Base
    {

        /// <summary>
        /// Initializes data that might not be available when the constructor is called.
        /// </summary>
        /// <param name="requestContext">The HTTP context and route data.</param>
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.DynaContentInitialization(requestContext);
            base.Initialize(requestContext);
        }

        /// <summary>
        /// Displays a dynamic content page
        /// </summary>
        /// <param name="friendlyUrl">The friendly URL.</param>
        /// <param name="language">The language.</param>
        /// <param name="controller">The controller.</param>
        /// <param name="action">The action.</param>
        /// <param name="layoutMenuId">The layout menu id.</param>
        /// <param name="structurePageId">The structure page id.</param>
        /// <param name="openingMessageResourceTag">The opening message resource tag.</param>
        /// <param name="openingMessageResourceStringFormatParameters">The opening message resource string format parameters.</param>
        /// <returns>ActionResult.</returns>
        [Authorize, HttpGet, CacheManager(enCacheMode.NoCache)] 
        public ActionResult Index(
            string friendlyUrl,
            string language,
            string controller,
            string action,
            int layoutMenuId,
            int structurePageId,
            string openingMessageResourceTag,
            string[] openingMessageResourceStringFormatParameters
        )
        {
            return base.Index(
                    friendlyUrl,
                    language,
                    controller,
                    action,
                    layoutMenuId,
                    structurePageId,
                    openingMessageResourceTag,
                    openingMessageResourceStringFormatParameters
                );
        }
        /// <summary>
        /// Sauvegarde du contenu d'une page
        /// </summary>
        /// <param name="id">Id = LayoutMenuId</param>
        /// <param name="model">The model.</param>
        /// <returns>JsonResult.</returns>
        [HttpPost, Authorize(Roles = "Admin"), ValidateInput(false)]
        public JsonResult Save(int id, DynaContent_ViewModel model)
        {
            return base.Save(id, model);
        }

    }
}
